<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>用户列表 - bjyadmin</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap/dist/css/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/animate.css/animate.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/font-awesome/css/font-awesome.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/simple-line-icons/css/simple-line-icons.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap-editable/css/bootstrap-editable.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/font.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/app.css" type="text/css" />
</head>
<body>

<div class="wrapper-md">
   <div class="panel panel-default">
    <div class="panel-heading">
        <a href="{:U('Admin/Index/index')}"><i class="fa fa-home"></i> 首页</a>
    &gt;
    用户列表
    <button class="btn btn-primary btn-xs menu-add pull-right" onclick="add(this)">添加用户</button>
    </div>
    <div class="table-responsive">
        <table class="table table-bordered table-striped table-hover table-condensed b-t b-light">
            <thead>
                <tr>
                    <th>用户名</th>
                    <th>身份证</th>
                    <th>邮箱</th>
                    <th>手机号</th>
                    <th>姓名</th>
                    <th>风险评分</th>
                    <th>注册时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="assign.data" id="v">
                    <tr>
                        <td>{$v['username']}</td>
                        <td>{$v['idcard']}</td>
                        <td>{$v['email']}</td>
                        <td>{$v['phone']}</td>
                        <td>{$v['name']}</td>
                        <td>{$v['pingfen']}</td>
                        <td>{$v['register_time'] | date="Y-m-d",time(###)}</td>
                        <td>
                            <a href="javascript:;" class="btn btn-info btn-xs" data-uid="{$v['id']}" data-uid="{$v['id']}" data-username="{$v['username']}" data-phone="{$v['phone']}" data-email="{$v['email']}" data-name="{$v['name']}" data-pingfen="{$v['pingfen']}" data-idcard="{$v['idcard']}" onclick="edit(this)">修改</a>
                            <a href="javascript:if(confirm('确定删除？'))location='{:U('Admin/User/delete',array('id'=>$v['id']))}'" class="btn btn-danger btn-xs">删除</a>
                            <a class="btn btn-info btn-xs" href="{:U('Admin/User/productlist',array('id'=>$v['id']))}">产品明细</a>
                            <a class="btn btn-info btn-xs" href="{:U('Admin/User/jylist',array('id'=>$v['id']))}">交易明细</a>
                        </td>
                    </tr>
                </volist>
            </tbody>
        </table>
    </div>
     <footer class="panel-footer">
        <div class="row text-center">
        {$assign.page}
        </div>
    </footer>
  </div>
</div>
<!-- 导航栏结束 -->
<!-- 添加用户模态框开始 -->
<div class="modal fade" id="bjy-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
         <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    添加用户
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="{:U('Admin/User/add')}" method="post">
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">用户名：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="username" >
                        </div>
                    </div>   
					<div class="line line-dashed b-b line-lg pull-in"></div>
					<div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">身份证：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="idcard" >
                        </div>
                    </div>   
					<div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">姓名：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="name" >
                        </div>
                    </div>  
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">风险评分：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="pingfen" >
                        </div>
                    </div>    
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">密码：</label>
                        <div class="col-sm-6">
                            <input type="password" class="form-control" name="password" >
                        </div>
                    </div>                    
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">电子邮箱：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="email" >
                        </div>
                    </div>                    
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">电话号码：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="phone" >
                        </div>
                    </div>
                    <div class="form-group m-b-none m-t-none m-l-none m-r-none">
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="col-sm-4 col-sm-offset-3">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- 添加菜单模态框结束 -->

<!-- 修改用户模态框开始 -->
<div class="modal fade" id="bjy-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
         <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    修改用户
                </h4>
            </div>
            <div class="modal-body">
               <form class="form-horizontal" action="{:U('Admin/User/edit')}" method="post">
                    <input type="hidden" name="id"/>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">用户名：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="username" >
                        </div>
                    </div> 
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">身份证：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="idcard" >
                        </div>
                    </div>    
					<div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">姓名：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="name" >
                        </div>
                    </div>            
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">风险评分：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="pingfen" >
                        </div>
                    </div>                 
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">密码：</label>
                        <div class="col-sm-6">
                            <input type="password" class="form-control" name="password" >
                        </div>
                    </div>                    
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">电子邮箱：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="email" >
                        </div>
                    </div>                    
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none">
                        <label class="col-sm-3 control-label" for="input-id-1">电话号码：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="phone" >
                        </div>
                    </div>
                    <div class="form-group m-b-none m-t-none m-l-none m-r-none">
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="col-sm-4 col-sm-offset-3">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- 修改菜单模态框结束 -->
<script src="__ADMIN_STATICS__/jquery/jquery.min.js"></script>
<script src="__ADMIN_STATICS__/bootstrap/dist/js/bootstrap.js"></script>
<script>
// 添加用户
function add(obj){
    $('#bjy-add').modal('show');
    $("input[name='username']").val('');     
    $("input[name='email']").val('');   
    $("input[name='phone']").val('');
	$("input[name='name']").val('');
	$("input[name='pingfen']").val('');
	$("input[name='idcard']").val('');
}
// 修改用户
function edit(obj){
    var id=$(obj).attr('data-uid');
    var username=$(obj).attr('data-username');
    var email=$(obj).attr('data-email');
    var phone=$(obj).attr('data-phone');
	var name=$(obj).attr('data-name');
	var pingfen=$(obj).attr('data-pingfen');
	var idcard=$(obj).attr('data-idcard');
    $("input[name='id']").val(id);
    $("input[name='username']").val(username);     
    $("input[name='email']").val(email);   
    $("input[name='phone']").val(phone);
	$("input[name='name']").val(name);
	$("input[name='pingfen']").val(pingfen);
	$("input[name='idcard']").val(idcard);
    $('#bjy-edit').modal('show');
}
</script>
</body>
</html>
